﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TelerikAcademyOopProject
{
    public class Spred
    {
        /*==========================================*/
        //              Spred FIELDS
        /*==========================================*/
        
        private decimal salePrice;
        private decimal purchasePrice;

        // hardcoded
        private double priceDerivativeCoefficient = 1.5;

        /*==========================================*/
        //              Spred PROPERTYES
        /*==========================================*/

        public decimal SalePrice
        {
            get { return salePrice; }
            set {

                //TODO: Price validation Method

                //if ((decimal)this.PriceDerivativeCoefficient * this.PurchasePrice < value)
                //{
                //    throw new StockException("The fouling price is too Hight");
                //}
                //else
                //{
                    salePrice = value; 
                //}
            }
        }

        public decimal PurchasePrice
        {
            get { return purchasePrice; }
            set { purchasePrice = value; }
        }

        public double PriceDerivativeCoefficient
        {
            get { return priceDerivativeCoefficient; }
            protected set { priceDerivativeCoefficient = value; }
        }

        /*==========================================*/
        //              Spred CONSTRUCTOR
        /*==========================================*/

        public Spred(decimal sp,decimal pp)
        {
            this.SalePrice     = sp;
            this.PurchasePrice = pp;
        }


    }
}
